window._NAMECREATOR = {


    _FNAME:null,
    _LNAME:null,

    getRandomName(){

        if(_NAMECREATOR._FNAME==null||_NAMECREATOR._LNAME==null){
            var tempfname = {};
            var templname = {};
            _NAMECREATOR._FNAME = [];
            _NAMECREATOR._LNAME = [];
            for(var key in _NPC){

                var npcname = _NPC[key].name;
                if(npcname&&npcname!='ATM'){
                    var word = npcname.split('');
                    if(word.length==2){
                        if(!tempfname[word[0]]){
                            tempfname[word[0]]=1;
                            _NAMECREATOR._FNAME.push(word[0]);
                        }
                        if(!templname[word[1]]){
                            templname[word[1]]=1;
                            _NAMECREATOR._LNAME.push(word[1]);
                        }
                    }
                }else{
                    //console.log(key+" 没有name",_NPC[key]);
                }

            }

        }


        var randomName = _CU.randomObj(_NAMECREATOR._FNAME)+_CU.randomObj(_NAMECREATOR._LNAME);

        if(_NPC[randomName]){
            console.log('和NPC重名：',randomName);
            return "张伟";
        }

        return randomName;

    },




}